/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "recarga")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Recarga.findAll", query = "SELECT r FROM Recarga r"),
    @NamedQuery(name = "Recarga.findByIdRecarga", query = "SELECT r FROM Recarga r WHERE r.idRecarga = :idRecarga"),
    @NamedQuery(name = "Recarga.findByFechaHora", query = "SELECT r FROM Recarga r WHERE r.fechaHora = :fechaHora"),
    @NamedQuery(name = "Recarga.findByMonto", query = "SELECT r FROM Recarga r WHERE r.monto = :monto")})
public class Recarga implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idRecarga")
    private Integer idRecarga;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechaHora")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaHora;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "monto")
    private BigDecimal monto;
    @JoinColumn(name = "cuit", referencedColumnName = "cuit")
    @ManyToOne(optional = false)
    private Vendedor cuit;
    @JoinColumn(name = "idTarjeta", referencedColumnName = "idTarjeta")
    @ManyToOne(optional = false)
    private Tarjeta idTarjeta;

    public Recarga() {
    }

    public Recarga(Integer idRecarga) {
        this.idRecarga = idRecarga;
    }

    public Recarga(Integer idRecarga, Date fechaHora, BigDecimal monto) {
        this.idRecarga = idRecarga;
        this.fechaHora = fechaHora;
        this.monto = monto;
    }

    public Integer getIdRecarga() {
        return idRecarga;
    }

    public void setIdRecarga(Integer idRecarga) {
        this.idRecarga = idRecarga;
    }

    public Date getFechaHora() {
        return fechaHora;
    }

    public void setFechaHora(Date fechaHora) {
        this.fechaHora = fechaHora;
    }

    public BigDecimal getMonto() {
        return monto;
    }

    public void setMonto(BigDecimal monto) {
        this.monto = monto;
    }

    public Vendedor getCuit() {
        return cuit;
    }

    public void setCuit(Vendedor cuit) {
        this.cuit = cuit;
    }

    public Tarjeta getIdTarjeta() {
        return idTarjeta;
    }

    public void setIdTarjeta(Tarjeta idTarjeta) {
        this.idTarjeta = idTarjeta;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRecarga != null ? idRecarga.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Recarga)) {
            return false;
        }
        Recarga other = (Recarga) object;
        if ((this.idRecarga == null && other.idRecarga != null) || (this.idRecarga != null && !this.idRecarga.equals(other.idRecarga))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Recarga[ idRecarga=" + idRecarga + " ]";
    }
    
}
